package com.jrh.web.admin;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.jrh.biz.brand.BrandService;
import com.jrh.domain.entity.Brand;
import com.jrh.domain.user.LoginUserInfo;
import com.jrh.web.member.tools.UserAuthUtil;

public class BrandSalesManager {

    public static Brand getBrandByUser(BrandService brandService, HttpServletRequest request,
                                       HttpServletResponse response) {
        LoginUserInfo user = UserAuthUtil.getUserInfo(request, response);
        if (user == null) {
            return null;
        }
        Brand brand = brandService.getBrandByUserId(user.getUserId());
        return brand;
    }
}
